<template>
  <div class="home">
    <el-button @click="handler">登录</el-button>
    <!-- <StoreSelectComp :signData="{id: 'id', value: 'name', label: 'label'}" :store="UserStore2" label-key="label" v-model="value"></StoreSelectComp> -->
    <StoreTableComp :store="TableStore1" :dataLabel="dataLabel">
      <el-table-column type="selection" width="55" align="center"></el-table-column>
      <el-table-column prop="objectName" label="项目名称" width="180" align="center"></el-table-column>
      <el-table-column prop="objectDate" label="项目日期" width="180" align="center"></el-table-column>
      <el-table-column prop="startTime" label="开始时间" width="180" align="center"></el-table-column>
      <el-table-column prop="endTime" label="结束时间" width="180" align="center"></el-table-column>
      <el-table-column prop="leadersName" label="项目负责人" width="180" align="center"></el-table-column>
      <el-table-column prop="personName" label="项目参与人" width="180" align="center"></el-table-column>
      <el-table-column prop="moneny" label="项目金额" width="180" align="center"></el-table-column>
    </StoreTableComp>
  </div>
</template>

<script>
import StoreSelectComp from './StoreSelectComp.vue'
import HelloWorld from '@/components/HelloWorld.vue'
import StoreTableComp from './StoreTableComp.vue'
import {UserStore2, UserStore1, UserStore3, TableStore} from '../userStore'
import { TableStore1 } from '../userStore2'

export default {
  name: 'HomeView',
  components: {
    HelloWorld,
    StoreSelectComp,
    StoreTableComp,
  },
  created(){
    this.UserStore = new UserStore1()
    this.UserStore2 = new UserStore2()
    this.UserStore3 = new UserStore3()
    this.TableStore = new TableStore()
    this.TableStore1 = new TableStore1()
  },
  data(){
    return {
      value: '',
      dataLabel: [
        '项目名称',
        '项目日期',
        '开始时间',
        '结束时间',
        '项目负责人',
        '项目参与人',
        '项目金额',
        '操作' 
      ]
    }
  },
  methods: {
    async handler() {
      try {
        await store.dispatch('userToken/setToken')
        await store.dispatch('userAuth/getAuthMenus')
        
        this.$router.push('/about');
      } catch (error) {
        console.log(error);
      }
    }

  }
}
</script>
